<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>顺风车---下沙最大的二手车交易平台</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="${ctx}/css/panels.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/css/index-css/book.css" rel="stylesheet" type="text/css" />
</head>
<body>
<script type="text/javascript">
function addToFavorlist(productId,productType){
	var user = "<s:property value='#session.niagara_security_session_login'/>";
	if(user == ""){
		alert("您还没有登录！");
		window.location = "${ctx}/login.action";
		return;
	}
	if(productType == "user"){
		var url= "${ctx}/home/friends!add.action";
		$.post(url,
			   {addUserId:productId},
		       function(data,status){
			       if(data==""){
				       alert("此用户已经加为您关注的好友！");
			       }else{
				       alert(data);
			       }			       
			   },'text'
		);
	}
	if(productType == "book"){
		var url= "${ctx}/home/favorite-book!add.action";
		$.post(url,
			   {bookId:productId},
		       function(data,status){
			       if(data==""){
				       alert("此书已经加入到您的收藏夹中！");
			       }else{
				       alert(data);
			       }
			   },'text'
		);
	}
};
function addToShoppingCart(productId){
	var quantity = $("#buy_num").val();
	var url= "${ctx}/shop/shopping-cart!add.action";
	$.post(url,
		   {productId:productId,quantity:quantity},
	       function(data,status){
		       var flag = confirm("已经加入到了购物车中！\n去购物车中查看？");
		       if(flag){
			       document.location.href = "${ctx}/shop/shopping-cart.action";
			   }
		   },'html'
	);
};
function checkBuyNum(o){
	var buy_num = $(o).val();
	if(buy_num <= 0){
		alert("请输入正确的数字");
		$(o).val(1);
	}
};

</script>
  <div class="wrap">
    <!--left start-->
    <div class="wrap_left">
      <div id="__samecategory_bk" class="left_div_yellow2">
        <h2 class="left_title">浏览更多同类商品</h2>
        <h3> <a class="black404040a" target="_blank" href='#' title='XXXXX'>XXXXXXXXXXXXX</a> </h3>
        <ul>
          <li><span class="point">&middot;</span><a class="blue12a" target="_blank"  href="#" title='XXXXXXXXXX'>XXXXXXX</a></li>
          <li><span class="point">&middot;</span><a class="blue12a" target="_blank"  href="#" title='XXXXXXXXXXX'>XXXXXXXXXXXXX<span class='dot'>...</span></a></li>
          <li><span class="point">&middot;</span><a class="blue12a" target="_blank"  href="#" title='XXXXXX'>XXXXXXXXX</a></li>
          <li><span class="point">&middot;</span><a class="blue12a" target="_blank"  href="#" title='XXXXXXXXX'>XXXXXXXXXXX<span class='dot'>...</span></a></li>
          <li class="l_more"><a href='#' class="blue12a" target="_blank">更多&gt;&gt;</a></li>
        </ul>
        <h3> <a class="black404040a" target="_blank" href='#' title='XXXXXXXXXXX'>XXXXXXXXX</a> </h3>
        <ul>
          <li><span class="point">&middot;</span><a class="blue12a" target="_blank"  href="#" title='XXXXXXXXXXX'>XXXXXXXXXX<span class='dot'>...</span></a></li>
          <li><span class="point">&middot;</span><a class="blue12a" target="_blank"  href="#" title='XXXXXXXXXX'>XXXXXXXXXX<span class='dot'>...</span></a></li>
          <li class="l_more"><a href='#' class="blue12a" target="_blank">更多&gt;&gt;</a></li>
        </ul>
      </div>
      <div id="recomend_browser"></div>
    </div>
    <!--left end-->
    <div class="wrap_right">
      <div class="right_wai">
        <div class="shuming">
          <div class="shuming_left"> <span class="black000"><a name="top_bk"></a><s:property value="bookDetail.bookName"/></span> </div>
          <div class="empty_box"></div>
        </div>
        <div class="book_left">
          <div class="book_pic"><img src="${ctx}<s:property value="bookDetail.imgPath"/>"  id="img_show_prd"  style="width:190px;height:230px;"/> </div>
          <input type="hidden" id="hid_largepictureurl"/>
        </div>
        <div class="book_right">
          <div id='publisher_'>品&nbsp;&nbsp;牌： <s:property value="bookDetail.publisher"/></div>
          <ul >
            <li>发   &nbsp;布   &nbsp;者： <s:property value="bookDetail.ownerId"/></li>      
            <li>发布时间： <s:date name="bookDetail.createTime" format="yyyy'-'M'-'d"/></li>
            
            <li>结束时间：<s:date name="bookDetail.finisherTime" format="yyyy'-'M'-'d"/></li>
            <li>品&nbsp;牌： <s:property value="bookDetail.isbn"/></li>
            <li>数&nbsp;量：<s:property value="bookDetail.count"/></li>
        	<li>分&nbsp;类：自行车&gt;&gt;二手自行车</li> 
        </div>
          <div class="jiage"> <span class="gray87">定价：<span class="del" id="originalPriceTag">￥<s:property value="bookDetail.origPrice"/></span></span> <span class="redc30" style="padding-left: 5px;">现价：￥<b><s:property value="bookDetail.price"/></b></span> 节省：<span class="redc30">￥<s:property value="bookDetail.origPrice-bookDetail.price"/></span>
            <div style="height:12px;"></div>
            <div class="pd_buy_num">
              <label>我要买：</label>
              <input type="text" value="1" id="buy_num" onkeyup="checkBuyNum(this);"/>
              <span class="pd_buy_num_unit"> 辆</span> <span class="pd_buy_num_note" style="display:none;" id="buy_num_text">请输入购买数量。</span>
              <div class="clear"></div>
            </div>
            <div class="goumai"> 
            	<a href="javascript:addToShoppingCart('<s:property value='bookDetail.bookId'/>');" title='购买' name='purchase_book'>
      				<img src='${ctx}/images/index-img/search/buttom_goumai.gif' onmouseover='this.src="${ctx}/images/index-img/search/buttom_goumai_over.gif"' 
      		     	     onmouseout='this.src="${ctx}/images/index-img/search/buttom_goumai.gif"' onmousedown='this.src="${ctx}/images/index-img/search/buttom_goumai_click.gif"' title='购买' />
            	</a>
            	<a id='favor' href="javascript:addToFavorlist('<s:property value='bookDetail.bookId'/>','book');" name='wishlist_book' title='收藏' >
            		<img id='imgfavor' src="${ctx}/images/index-img/search/buttom_favorite.gif" onmouseover='this.src="${ctx}/images/index-img/search/buttom_favorite_over.gif"' 
      			 		 onmouseout='this.src="${ctx}/images/index-img/search/buttom_favorite.gif"' onmousedown='this.src="${ctx}/images/index-img/search/buttom_favorite_click.gif"' title="放入收藏"/>
            	</a>
            	<span><s:if test="userDetail.qq!=null"><a href='tencent://message/?uin=<s:property value='userDetail.qq'/>&Site=顺风车二手车平台&Menu=yes'><img border="0" src='http://wpa.qq.com/pa?p=1:<s:property value='userDetail.qq'/>:1' /></a></s:if></span>
            </div>
          </div>
        </div>
        <div id="dvTPUrls"></div>
        <div id="__zhinengbiaozhu_bk">
          <div class="dashed"></div>
          <h2 class="black14"><img src="${ctx}/images/index-img/search/bg_point1.gif" align="absmiddle" /> 店主推荐说明</h2>
          <div class="zhengwen">　　
            <s:if test="bookDetail.content != null">
 				<s:property value="bookDetail.content"/>
          	</s:if>
          	<s:else>
          		对不起，店主没有对这本书的评论！
          	</s:else>
         </div>
          <div class="dashed"></div>
         
          <h2 class="black14"><img src="${ctx}/images/index-img/search/bg_point1.gif" align="absmiddle" /> 二手车相关评论</h2>
          <div class="zhengwen">
          	<s:if test="commentList.size != 0">
          	    <s:iterator value="commentList" status="itStatus">
          	    	第${itStatus.index+1}条评论：<br/>
          	    	<s:property value="comment"/>
          	    </s:iterator>
          	</s:if>
          	<s:else>
          		对不起，本车还没有相关的评论！
          	</s:else>
          </div>
        </div>
      </div>    
    </div>
    <!--right end-->
    <div class="clear"></div>

</body>
</html>